<%@ page contentType="text/html; charset=UTF-8" %>
<jsp:directive.page import="com.syzg.core.util.StringUtil"/>
<%@ page import="com.syzg.common.config.SysProperties" %>
<jsp:directive.page import="com.syzg.common.model.WebInfo"/>
<%@ include file="/base/jsp/common/Taglibs.jsp"%>
<%@ include file="/base/jsp/common/CustomTheme.jsp"%>
<% 
response.setHeader("Pragma","No-cache"); 
response.setHeader("Cache-Control","no-cache"); 
response.setDateHeader("Expires", 0); 
%>
<script language="JavaScript">
var rootURL='<%=ctx%>';
var debug = <%=debug%>;
var opType = '<%=(String)request.getParameter("opType")%>';
var openType = <%=openType%>;
if(!openType) {
    openType = <%=openType%>;
}
 
var actionStatus = '${webObj.webInfo.actionStatus}';//action 的操作状态
var errorInfo = null;
var info = '';
<c:forEach items="${webObj.webInfo.errorList}" var="errorInfo">
	if(!errorInfo) {
		errorInfo = "";
	}
 	errorInfo += '\n${errorInfo}';
</c:forEach>
if(errorInfo&&errorInfo!='') {
    alert("操作失败:" + errorInfo);
}

<c:forEach items="${webObj.webInfo.infoList}" var="info">
	info += '\n${info}';
</c:forEach>

if(actionStatus && actionStatus == '<%=WebInfo.STATUS_SUCCESS%>') {//保存成功
    if(openType && openType=='1') {
 		alert("您的操作已成功。\n"+info);
 		var url = parent.url;
 		if(url) {
 			window.location.href = url;
 		}
	} else {//弹出页面
 		var closeWindow = window;
 		
 		if(!opener) {
 			opener = parent.opener;
 			closeWindow = parent.window;
 		}
 		try {
 			opener.refreshSearch();
 		} catch(e) {
 		}
 		alert("您的操作已成功。\n"+info);
 		closeWindow.close();
	}
} else if(actionStatus && actionStatus == '<%=WebInfo.STATUS_FAILURE%>'){
	if(info != null && info != '') {
 		alert(info);
 	}else {
 		alert("操作失败");
 	}
}
</script>